﻿//-----------------------------------------------------------------------
// <copyright file="HasUnencapsulatedBoundaryConditions.cs" company="None">
//     Copyright (c) 2009-2011
// </copyright>
//-----------------------------------------------------------------------

using System;

namespace CleanCode.StyleCopCustomRules.UnitTests.Resources
{
    /// <summary>
    /// Dummy class to unit test the customized StyleCop rules.
    /// </summary>
    public class HasUnencapsulatedBoundaryConditions
    {
        /// <summary>
        /// Dummy field holding the Level.
        /// </summary>
        private const int Level = 0;

        /// <summary>
        /// Dummy field holding the Offset.
        /// </summary>
        private const int Offset = 0;

        /// <summary>
        /// Dummy field holding the tags.
        /// </summary>
        private string[] tags;

        /// <summary>
        /// Dummy field holding the tags.
        /// </summary>
        private Parse parts;

        /// <summary>
        /// Dummy field holding the body.
        /// </summary>
        private string body;

        /// <summary>
        /// Initializes a new instance of the <see cref="HasUnencapsulatedBoundaryConditions"/> class.
        /// </summary>
        public HasUnencapsulatedBoundaryConditions()
        {
            const int InitialArraySize = 10;
            tags = new string[InitialArraySize];
            Foo();
        }

        /// <summary>
        /// Fooes this instance. Well I really have no idea what the code example from the book is doing.
        /// </summary>
        private void Foo()
        {
            const int EndTag = 3;
            if (Level + 1 < tags.Length)
            {
                parts = new Parse(body, Level + 1, Offset + EndTag);
                body = null;
            }
        }

        /// <summary>
        /// Dummy class to unit test the customized StyleCop rules.
        /// </summary>
        private class Parse
        {
            /// <summary>
            /// Initializes a new instance of the <see cref="Parse"/> class.
            /// </summary>
            /// <param name="body">The body to parse.</param>
            /// <param name="level">The Level to parse.</param>
            /// <param name="offset">The Offset to parse.</param>
            public Parse(string body, int level, int offset)
            {
                throw new NotImplementedException();
            }
        }
    }
}
